package severlet;

import dao.LaterecordDao;
import dao.LeaveReturnDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "AdminDelLaterecordInfoServlet", value = "/AdminDelLaterecordInfoServlet")
public class AdminDelLaterecordInfoServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("utf-8"); // 设置编码格式
        request.setCharacterEncoding("utf-8");

        //
        String studentname = request.getParameter("studentname");

        LaterecordDao laterecordDao=new LaterecordDao();
        laterecordDao.delInfoBySutdentname(studentname);
        //请求转发
        request.getRequestDispatcher("/AdminLaterecordServlet").forward(request,response);
    }
}
